<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>优视雅 后台管理</title>
  <link rel="stylesheet" href="__LAYUI__/css/layui.css">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">

    {block name="css"}

    {/block}

  <div class="layui-header">
    <div class="layui-logo">优视雅 后台管理</div>

    <!-- 头部区域（可配合layui已有的水平导航） -->
    <!-- <ul class="layui-nav layui-layout-left">
      <li class="layui-nav-item"><a href="">控制台</a></li>
      <li class="layui-nav-item"><a href="">商品管理</a></li>
      <li class="layui-nav-item"><a href="">用户</a></li>
      <li class="layui-nav-item">
        <a href="javascript:;">其它系统</a>
        <dl class="layui-nav-child">
          <dd><a href="">邮件管理</a></dd>
          <dd><a href="">消息管理</a></dd>
          <dd><a href="">授权管理</a></dd>
        </dl>
      </li>
    </ul> -->
    <ul class="layui-nav layui-layout-right">
      <li class="layui-nav-item">
        <a href="javascript:;">
          <!-- <img src="http://t.cn/RCzsdCq" class="layui-nav-img"> -->
          {$userName}
        </a>

          <dl class="layui-nav-child">
              <dd><a onclick="savePasswd()">修改密码</a></dd>
          </dl>

      </li>
      <li class="layui-nav-item"><a href="{:url("Admin/quitLogin")}">退了</a></li>
    </ul>
  </div>
  
  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree"  lay-filter="test">
        <li class="layui-nav-item"><a href='{:url("Index/index")}'>首页</a></li>
        {foreach $navList as $v}
          <li class='layui-nav-item <?php if( in_array( $navArr["nav_controller"], $v["controllers"]) ){ echo "layui-nav-itemed"; } ?>'>
            <a class="javascript:;" href="javascript:;">{$v.name} <span class="layui-nav-more"></span></a>
            <dl class="layui-nav-child">
                {foreach $v.list as $vv}
                <dd class='<?php if( $vv["nav_controller"] == $navArr["nav_controller"] && $vv["nav_action"] == $navArr["nav_action"]){  echo "layui-this"; } ?>'>
                    <a href='{:url($vv.url)}'>{$vv.name}</a>
                </dd>
                {/foreach}
            </dl>
        </li>
        {/foreach}
      </ul>
    </div>
  </div>
  

  <div class="layui-body">
    <!-- 内容主体区域 -->
    {block name='html'}
      <div style="padding: 15px 20px;">
            <div class="content">
                <div class="content-top">
                    <p>{$headerName}</p>
                </div>
                <div style="padding: 10px;">
                    {block name="content"}

                    {/block}
                </div>
            </div>
        </div>
    {/block}
  </div>
  
  <div class="layui-footer">
    <!-- 底部固定区域 -->
    © www.yosiya.net - 优视雅集团有限公司
  </div>
</div>

<script src="__COMMON__/js/jquery-3.2.1.min.js" charset="utf-8"></script>
<script src="__LAYER__/layer.js" charset="utf-8"></script>
<script src="__LAYUI__/layui.js"  charset="utf-8"></script>
<script src="__ADMIN__/js/common.js" charset="utf-8"></script>
<script>
    window.global = {
        pageType: 'demo'
        ,preview: function(){
            var preview = document.getElementById('LAY_preview');
            return preview ? preview.innerHTML : '';
        }()
    };
    var web_width = window.innerWidth;
    if( web_width <= 1200 ){
        layui.config({
            base: '__LAYUI__/'
        }).use('global');
    }

    function savePasswd(){
        layui.use('layer', function(){
            var layer = layui.layer;

            layer.open({
                title:"修改密码",
                type: 2,
                area: ['500px', '400px'],
                content: ['{:url("Admin/savePasswd")}', 'no'],
                end: function () {
                    location.reload();
                }
            });
        });
    }
</script>

<div id="LAY_democodejs">
    <script>
        layui.use('element', function(){
            var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块

            //监听导航点击
            element.on('nav(demo)', function(elem){
                //console.log(elem)
                layer.msg(elem.text());
            });
        });
    </script>
</div>

{block name="javascript"}{/block}

</body>
</html>